CSV2FXT SCRIPT
To achieve 99.0% modeling quality in backtesting using MetaTrader 4 (MT4), you can use Birt's CSV2FXT script. This process involves converting tick data into a format that MT4 can use for accurate backtesting. Here's a step-by-step guide on how to do this:
Prerequisites
- MetaTrader 4 Platform: Ensure you have MT4 installed on your computer.
- Birt's CSV2FXT Script: Download link is provided at the end/bottom of this page.
- Tick Data: Obtain tick data for your desired currency pair and time period. Popular sources include Dukascopy and TrueFX.
- Tickstory lite free version (optional but recommended).
Step-by-Step Guide
Step 1: Prepare Your Environment
- Install MetaTrader 4: Ensure MT4 is up and running on your machine.
- Download and Install Tickstory lite:
Step 2: Download Tick Data with Tickstory Lite
- Select Data Source: Open Tickstory Lite and select your desired currency pair and time period.
- Download Data: Click on the download icon. Ensure to set the export format to MetaTrader 4 or CSV if required.
- Data Quality: Tickstory Lite provides high-quality historical data suitable for backtesting.
- Export to MT4: After downloading, export the data directly to your MT4 installation for easy access.
Step 3: Convert CSV to FXT
- Place CSV2FXT Script:Copy the contents of the `mql4` folder within the `csv2fxt` folder and paste the three folders—`include`, `libraries`, and `scripts`—into the `MQL4` directory of your MT4 platform.
- Prepare CSV File: Ensure your CSV file is correctly formatted, typically with columns for date, time, bid, and ask prices.
Step 4: Run CSV2FXT Script
- Launch MT4: Open your MetaTrader 4 platform.
- Navigate to Scripts: Go to the Navigator panel, expand the
Scripts
section, and find CSV2FXT. - Run the Script:
- Drag the CSV2FXT script onto a chart of the currency pair for which you downloaded the data.
- A settings window will appear. Configure the parameters, including the CSV File (it must be placed in the MQL4 folder
mq4/files
), timeframe, spread, and other relevant options. - Click "OK" to run the script. This will convert the CSV data into an FXT file that MT4 can use for backtesting.



Step 5: Set Up Backtesting (Launch MT4 through Tickstory Lite)
- Launch MT4 via Tickstory Lite: Open Tickstory Lite and use the "Launch MT4" option to ensure your platform recognizes the tick data you've downloaded. This step is essential to achieve accurate backtest results.
- Open Strategy Tester: In MT4, go to
View > Strategy Tester
. - Select Expert Advisor: Choose the EA you wish to test.
- Choose Currency Pair and Timeframe: Ensure these match the data you've converted.
- Set Model to "Every Tick": This option uses the generated FXT file for 99.0% modeling quality.
- Configure Other Settings: Adjust the date range, initial deposit, and other relevant settings.
- Run the Test: Click "Start" to begin the backtest.
Step 6: Analyze Results
- Check Modeling Quality: Ensure the report shows 99.0% modeling quality.
- Evaluate Performance: Analyze the results to understand how the EA performs under the tested conditions.
Tips for Success
- Data Integrity: Ensure your tick data is complete and free of errors to achieve accurate results.
- Spread and Commission: Set realistic values for spread and commission to reflect live trading conditions.
- Use TDS Features: If using TDS, take advantage of features like variable spreads, slippage, and walk-forward analysis for more robust testing.
By following these steps, you should be able to achieve high modeling quality in your MT4 backtests, providing a more accurate representation of potential live trading performance.